TOD: Animation Data
TOD format is used for specifying information along the flow of time, relative to a 3-
dimensional object. It
corresponds to the extended graphics library (libgs).
To be more precise, for each frame in a 3-dimensional animation (or frame sequence), the
TOD file
describes the required data relating to the 3-dimensional objects to be created, modified, or
erased, and
arranges the data for each frame along the flow of time.
A TOD file, as shown below, corsets of a file header followed by frarne data.
Figure 2-64: TOD file format
fe ft,
Header
At the top of the TOD file, there is a 2-word (64-bit) HEADER, in which the following four
kinds of
information are described.
(a) File ID (8 bits)
This identifies the file as an animation file. Its value is Ox50.
(b) Version (8 bits)
Animation version. Its value starts at 0x00.
(c) Resolution (16 bits)
This is the time in which 1 frame is displayed (in units of ticks (1 tick = 1/60 seconds)).
(d) Number of frames (32 bits)
This is the number of frames described in the file.
Frame
Following the header the frame is described. Frames are arranged chronologically
Each FRAME consists of a frame header followed by a PACKET, as shown below.
Figure 2-65: Frame
Frame Header
There is a 2 word frame header at the beginning of each frame. The following information is
described ina
frame header.
“ Frame size (16 bits)
Frame length (including header) in words.
* Number of packets (16 bits)
Number of packets.
” Frame numbers (32 bits)
Frame number.
PACKET
After the frame header come the PACKETS. Each PACKET consists of a one-word packet
header at the
top, followed by the packet data (See Figure 2-50). There are several different kinds of
PACKETS.
The size of the packet data in each PACKET will of course be different if the PACKETS are
of different
kinds; even if the PACKETS are of the same kind, the size of the packet data may be
different.
A PACKET consists of a packet header and packet data, as shown below.
Figure 2-66: PACKET
MSA LB
11 t
.:—<$<£@—@oi—_——_—_—_—_— 2 es S
Packet Header
The PACKET header contains the following information.
“ Object ID (16 bits)
The identification of the object to be handled.
“ Packet type (4 bits)
The type of packet data.
” Flag (4 bits)
The meaning of the flag varies from packet to packet.
“ Packet length (8 bits)
This is the size of the packet (including the header) in units of words (4 bytes).
Object refers to a 3-dimensional object (a GSDOBJ2 structure) handled by libgs (the
extended graphics
library) which is to be made to reflect the packet data.
Packet type contains the classification of the data stored in the packet data. The significance
of the flag
varies according to the packet type.
Packet length indicates the length of the packet in units of words (4 bytes).
Packet Data
Several kinds of data, such as the GSCOORDINATE2 structure RST value and the TMD data
ID (the
modeling data ID), are stored in the packet data.
The packet type slot in the header indicates which type the PACKET is. The relationship
between the
packet type value and the type of data is as follows:
Figure 2-67: packet type values and packet data contents
J Alibule
1 Coordinate [RST]
10 IMO data IO
11 Parent object Ib
100 Matrix value
101 IMO data
110 Light Source
111 Camera
1000 Object cornia
1001 - 1101 User defined
1110 sylem reserved
1111 Secial Commands
The different kinds of data are explained below.
Packet Data-Attribute
When packet type is 0000, the data that designates attribute of the GSDOBJ structure in the
packet data is
stored. In this case a flag Is not used.
Packet data is composed of 2 words as follows:
Figure 2-68: Packet Data Configuration when Attribute
MSE LSB
31/30] 29] 28| == 8| 7 1615/4) 312/110
3130] 29] 28] — 8/76] 5}4/3]2{ijo
L
resape
mask.
Hew sahi
The first word is a mask which indicates the section which changes value and the section
which does not
change value. O is set in the bit which corresponds to the item which will change and 1 is set
in the bit for
the value which will not change.
In the second word, new data is input to the bits corresponding to items which are going to
change, and
the other bits are set to O.
Note that the first and second words differ in the following respect: in the first word, the
default value for the
bits which are not going to be changed is 1, while in the second word, this default value is 0.
The breakdown of the bits of the second word packet data shown in Figure 2-52 is described
below.
Table 2-7: Packet data bit-by-bit breakdown
Bit [0] - bit [2] Material camping
OO : Material damping 0
O1 : Material damping 1
O2 : Material damping 2
Od : Material damping 3
Bit |] Lighting made, part 1
QO: Fog aff irie feg]
1: Fog on flag)
Bit |4] Lighting mode, part 2
J: Maternal on [material
1: Maternal off tna material)
Bit [5] Lighting made, part 3
g: Use lighting made
l: Use default fighting mode
Bit || Light source
J: Light-source cabculation aff
l: Forced light-source calculation on
Bit [7] Neart overflows handling
J: 2 overflow cho
1: 2 overflow not clip
Bit [E] Back clipping statues
J: Valid
1: invabd
Bit |S - bit [27h Reserved lintialized at Ol
Bit |28) - bat (2) =ernl-lansparenicy rate
00: 50% back + 50% polygon
01 : 100% back + 100% pofygan
10: 100% back - 100% polygon
11: 50% back + 25% polygon
Bit |20) =ernl-lansparency rate
J: Of
7 On
Bit (31) Display
QO: Display
1: No display
For example, to switch forced light-source calculation ON, the packet data bits should be set
as shown in
Figure 2-53.
Bit (6) of the first word is given the value 0, showing that the light source is to be changed.
The other bits
are given the value 1, showing that they are not going to be changed. Accordingly, the first
word is Oxffbf.
Bit (6) of the second word is given the value 1 to indicate that forced light-source calculation
is ON, and the
other bits, which correspond to items which are not going to be changed, are given the
default value 0. The
second word is therefore 0x0040.
Figure 2-69: packet data when forced light-source calculation i switched ON
MSB LSB
ape hhehihihi] e ms
poppocapnnnnnnnni naw vale
Packet Data-Coordinate (RST)
When packet type is 0001, data that sets the coordinates of the GSDOBJ structure is stored
In packet
data.
In this case the flag will have the following meaning.
Figure 2-70: Flag when Coordinate (AST)
renmslation rotation matrix type
Matrix type: RST matrix type
0: Absolute value
1: Differential matrix from preceding frame
Rotation: Rotation (R) flag
0: None
1: Has
Scaling Screening (S) flag
0: None
1: Has
Translation Parallel movement (T) flag
0: None
1: Has
The configuration of packet data will differ according to the values of the flag rotation bit, the
scaling bit,
and the translation bit as per Figure 2-54.
In Figure 2-55, Rx, Ry and Rz indicate one degree as 4096, with a fixed point decimal value
(1, 19, 12) that
indicate the X axis component, the Y axis component, and the Z axis component of the angle
of rotation. In
the same way, Sx, Sy and Sz indicate the X axis component, the Y axis component, and the
Z axis
component of the scaling as a fixed point decimal (1, 3, 12), while Tx, Ty and Tz respectively
indicate the X
axis component, the Y axis component, and the Z axis component of the translation as an
integer (1, 31, 0)
that signals 32 bits.
Figure 2-71: Packet Data Configuration when Coordmate (RST)
ial Mag 1110 of 1111 ib} Magg: 0110 o 0111
el Nag: 1010 or 1011
{el flag: 0070 or 0511 iÑ fleg: 0100 or 0101
| sy |e
en e
(gl Tag: 1000 er 1001
Packet Data-TMD Data ID
When packet type is 0010, the modeling data ID (TMD data) of the real object is stored in the
packet data
(See Figure 2-56). The TMD data ID is composed of 2 bytes. In this case no flag is used.
Figure 2-72: Packet Data Configuration when TMO Data IB
ke 16 bit =
| aeeweeeee TMD data ID
Packet Data- Parent Object ID
When packet type is 0011, the parent object ID of the object specified is stored in packet data
(see Figure
2-57). The parent object ID is composed of 2 bytes. In this case no flag is used.
Figure 2-73: Packet Data Configuration when Parent Object
E 16 bit - |
Pare object ID
Packet Data - MATRIX Value
When the packet type is 0100, the data which designates coord members of the
GsCOORDINATE2
structure to which GSDOBJ2 structure points is stored in packet data. In this case a flag is
not used.
Figure 2-74: Packet Data Configuration when Mat rix Value
Pee e
Packet Data-TMD Data Body
When packet type is 0101, TMD data is stored. This is not presently supported.
Packet Data-Light Source
When packet type is 0110, the data that designates light source is stored in packet data.
When this is the
case, the object ID is separate from the normal object ID and becomes the light source ID.
Flags have the
following meanings:
Figure 2-75: Flag when Light Source Packet
Data type: Data type
0: Absolute value
1: Difference from preceding frame
Direction: Direction flag
0: None
1: Has
Color: Color flag
0: None
1: Has
The configuration of packet data will differ according to the value of the flag direction bit and
the color bit.
Figure 2-76: Packet Data when Light Source Packet
(a) flag: 0110 or 0111 ib] flag: 0100 or 0101
Packet Data-Camera
When packet type is 0111, data which designates viewpoint location information is stored in
the packet.
When this is the case, the object ID is separate from the normal object ID and becomes the
camera ID.
Flags have the meaning indicated in Figure 2-61. Please be careful to note that the meaning
of other bits
will change depending on the type bit.
Figure 2-77: Flag for Camera
(a) camera type: 0
postion à data type Camera type
referers aff
ial camera type: 1
translation data type camera type
=]
When camera type bit is O other bits are:
Data type: Data type
0: Absolute value
1: Difference from preceding frame
Position & reference Position and reference position flag
0: None
1: Has
z angle Reference angle flag from level
0: None
1: Has
When camera type bit is 1 other bits are:
Data type: Data type
0: Absolute value
1: Difference from preceding frame
Rotation: Rotation (R) flag
0: None
1: Has
Translation: Horizontal movement (T) flag
0: None
1: Has
The structure of packet data differs according to the flag content, as shown in Figs.2-62 and
2-63.
Figure 2-78: Composition of packet data with camera (part 1)
a flag: 1100 o¢ 1110 ib) lag: 0100 ar 0110
iċ} flag: 1000 or 1010
Ix, Ty, TE: Camera positio
[Ra TRY, TRE: Camera case-up posibor
Figure 2-79: Composition of packet data with camera (part 2)
a flag: 1101 o¢ 1111 ib) lag: 0101 or 0111
HE, Ry, RE: Rotatarn
Ix, Ty, Te: Tramslaton
Packet Data-Object Control
If the packet type is 1000, object control is not set. In this case, there is no packet data. The
flag has the
meanings shown below.
Figure 2-80: The meanings and values of the flag when object control is set
systern
E-E-
Packet Data-Extended Commands
If the packet type is 1110, it shows the extended commands.
Packet Data-Special Commands
If the packet type is 1111, animation control is performed. Details of these special commands
have not yet
been finalized.